<template>
  <div class="app-container ">
    <!--通知公告-->
       
   
         <el-card shadow="hover">
           <el-row type="flex" class="row-bg" justify="center" :gutter="20">
              <el-col :span="12">
                <el-input
                placeholder="请输入标题"
                prefix-icon="el-icon-search" clearable v-model="noticeParams.noticeName">
                </el-input>
              </el-col>
              <el-col :span="4">
                <el-button icon="el-icon-search" circle @click="selectCompany"></el-button>
              </el-col>
            </el-row>
                <div  v-for="(item) in noticeList" :key="item.notifyId" :offset="1" style="margin-top:20px">
                  <el-card shadow="hover" >
                      <a @click="toDetail(item)">
                         <el-row :gutter="12" >
                          <el-col >
                            <div>
                              <span style="font-size:20px; color:#409EFF; ">{{item.noticeTitle}}</span>
                            </div>
                          </el-col>
                          <el-col >
                            <diV style=" text-align: right; ">
                              <span style="font-size:20px; color:#409EFF;">{{item.createTime}}</span>
                            </diV>
                          </el-col>
                        </el-row>
                      </a>
                  </el-card>
                  <el-divider ></el-divider>
                </div>
         </el-card>
  </div>
</template>

<script>
import { getMyNoticeList } from '@/api/notice';

export default {
  data() {
    return {
      noticeList:[],
      total:0,
      noticeParams:{
        noticeName:''
      }
  }
},
 //页面打开时执行的方法
  created() {
    this.getMyNoticeList()
  },
   methods:{
      async getMyNoticeList(){
      let res = await getMyNoticeList(this.noticeParams);
      this.noticeList = res.beans;
      this.total = res.bean.total;
      },
      toDetail(item){
        this.$router.push({
          path: "/noticeDetail",
          query:{
            noticeId:item.noticeId
          }
          })
      }
   }
}
</script>

